package com.sanno.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sanno.common.entity.SncUserLogin;
import com.sanno.user.mapper.UserMapper;
import com.sanno.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, SncUserLogin> implements UserService {

    @Resource
    private UserMapper userMapperImpl;

    @Override
    public boolean updateName(SncUserLogin sncUserLogin) {
        int i = userMapperImpl.updateName(sncUserLogin);
        if (i>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean updatePwd(SncUserLogin sncUserLogin) {
        int i = userMapperImpl.updatePwd(sncUserLogin);
        if (i>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean insertIp(Integer id , String Ip) {
        int i = userMapperImpl.insertIp(id,Ip);
        if (i>0){
            return true;
        }
        return false;
    }
}
